﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using SchemaMonitor;
using Framework;

public partial class usercontrols_UCCheck : System.Web.UI.UserControl
{

    public void Display(CCheck c)
    {
        if (0 != this.Parent.Controls.Count % 2)
            row.Attributes.Add("class", "alt_row");

        lblCreated.Text = CUtilities.Timespan(c.CheckStarted);
        lblCreated.ToolTip = CUtilities.LongDateTime(c.CheckStarted);

        lblTime.Text = CUtilities.Timespan(c.Elapsed);

		lblApi.Text = c.CheckApiCalls.ToString("n0");
		lblInsUpdDel.Text = string.Concat(c.CheckInserts, "-", c.CheckUpdates, "-", c.CheckDeletes);

        //lblError.Text = CUtilities.Truncate(c.CheckErrors, 200);
        // lblError.ToolTip = c.CheckErrors;
        lblError.InnerText = c.CheckErrors;

        if (DateTime.MinValue == c.CheckFinished && c.Elapsed.TotalHours > 1)
            lblTime.Text = "Failed";
    }
}